﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<Ecommerce.Admin.Models.ArticleViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Sửa tin tức
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <form action="" method="post" id="formCreate" enctype="multipart/form-data" >
    <input type="hidden" id="CheckType" name="CheckType" value="" />
    <div style="width:100%; margin:0 auto;">

        <style type="text/css">
            .Breadcrumb { padding-top: 6px; padding-bottom: 6px; }
            .Breadcrumb ul, .Breadcrumb li { list-style: none outside none; margin: 0; padding: 0; }
            .Block ul li { margin-top: 5px; }
            .Breadcrumb li { display: inline; padding-left: 6px; }
            .Breadcrumb li a{ background: url("images/breadcrumbsep.gif") no-repeat scroll right center transparent; color: #005FA3; font-weight: normal; padding-right: 10px; text-decoration: none; }
            .Breadcrumb li a:hover{ text-decoration: underline; }
        </style>

        <div id="Breadcrumb" class="Block Breadcrumb ui-widget-content ui-corner-top ui-corner-bottom">
            <ul>
                <li><a href="#">Trang chủ</a></li><li>Sửa tin tức</li>
            </ul>
        </div>
        <div style="clear: both;"></div>


        <div id="ctl00_cph_Main_Content" style="width:100%; height:100%;"><div id="ctl00_cph_Main_ctl00_ContentPane" style="vertical-align:top;">
                <div id="ctl00_cph_Main_ctl00_ctl00_MenuTab_divSubMenu" class="ui-widget-content ui-corner-top ui-corner-bottom" style="margin: 5px 0px 5px 0px; height: 25px;">
                    <div style="padding: 5px; float: right;">
                        <% Html.RenderPartial("Head"); %>
                    </div>
                </div>
                <div class="ui-widget-content ui-corner-top ui-corner-bottom">
                    <div id="toolbox">
                        <div style="float:left;" class="header">
                            <img id="ctl00_cph_Main_ctl00_ctl00_toolbox_imgHeader" src="/Content/Images/header/icon-news.png" style="border-width: 0px;">
                            <span id="ctl00_cph_Main_ctl00_ctl00_toolbox_lblTitle">Thêm mới tin tức</span>
                        </div>
                        <div style="float:right;">

                            <table class="toolbar">
                                <tbody>
                                    <tr>               
                                        <td align="center">
                                            <a href="#" class="toolbar" onclick="beginUpload();" title="Lưu" id="c1"><span class="Icon-32-Save" title="Lưu" id="d1"></span>Lưu</a>
                                        </td>

                                        <td align="center">
                                            <a href="#" class="toolbar" onclick="beginUpdate();" title="Cập nhật" id="c2"><span class="Icon-32-Apply" title="Cập nhật" id="d2"></span>Cập nhật</a>
                                        </td>

                                        <td align="center">
                                            <a href="/Article" class="toolbar" title="Quay lại" id="c3"><span class="Icon-32-Back" title="Quay lại" id="d3"></span>Quay lại</a>
                                        </td>

                                    </tr>
                                </tbody>
                            </table>                
                        </div>
                    </div>                                                                                                                                                                                   

                </div>
                <div class="ui-widget-content ui-corner-top ui-corner-bottom" style="padding: 2px; margin: 5px 0px 5px 0px;">
                    <div style="padding-top:10px;<%= ViewData["Notice"] %>">    
                        <div class="Notice-Info" >
                            <span>Sửa tin tức thành công</span>
                        </div>        
                    </div>
                    <div>
                        <script type="text/javascript">
                           
                        </script>
                        <div id="tabs">
                            <ul>
                                <li><a href="#tabs-1">Thông tin chi tiết</a></li>                                
                            </ul>
                            <div id="tabs-1">
                                <table class="admintable" style="padding: 0px 5px;" width="100%">
                                    <tbody><tr>
                                            <td style="height: 10px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" style="width: 150px;">
                                                <span class="subhead">Tiêu đề</span> <span class="Footer">(*)</span>
                                            </td>
                                            <td>
                                                <input type="text" class="input-w" name="Title" value="<%=Model.Article.Title %>" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" style="width: 150px;">
                                                <span class="subhead">Danh mục tin</span> <span class="Footer">(*)</span>
                                            </td>
                                            <td>
                                                <select multiple="multiple" name="CategoryId" style="width:300px;height:150px">
                                                <option value="0">Root</option>
                                                    <%= Model.Categories %>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" style="width: 150px;">
                                                Mô tả ngắn
                                            </td>
                                            <td>
                                                <textarea name="Summary" style="height:100px" class="input-w"><%=Model.Article.Summary %></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key">
                                                Ảnh chính
                                            </td>
                                            <td>
                                            <% string img = Model.ImagePath + Model.Article.ImagePath; %>
                                            <img src="<%=img %>" width="128px" height="128px" /><br />
                                                <input type="file" name="ImagePath" value="" />                                        
                                            </td>
                                        </tr>                                                                                                   
                                        
                                        <tr>
                                            <td class="key">
                                                Trạng thái hiển thị
                                            </td>
                                            <td>
                                                <%= Html.DropDownList("Status", new SelectList(Ecommerce.Admin.Controllers.ArticleController.GetStatus(), "Value", "Text", Model.Article.Status))%>                                                                                                                                                                                                                    
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key">
                                                Nội dung chi tiết
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">      
                                                <script type="text/javascript">
                                                    $j(document).ready(function() {
                                                        CKEDITOR.replace('ContentDetail',
                                                        {
                                                            toolbar: [
                                                                ['Source'], '-',
                                                                ['Preview', 'Print', 'Templates'], '-',
                                                                ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'], '-',
                                                                ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'RemoveFormat'],
                                                                ['Bold', 'Italic', 'Underline', 'Strike'], '-',
                                                                ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], '-',
                                                                ['Link', 'Unlink'], '-',
                                                                ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'], '-',
                                                                '/',
                                                                ['Styles', 'Format', 'Font', 'FontSize'], '-',
                                                                ['TextColor', 'BGColor'], '-',
                                                                ['Maximize', 'ShowBlocks']
                                                            ],
                                                            language: 'vi',
                                                            height: 400,
                                                            resize_enabled: false,
                                                            toolbarCanCollapse: false,
                                                            filebrowserBrowseUrl: '/Extensions/HtmlEditor/ckeditor/ckfinder/ckfinder.html',
                                                            filebrowserImageBrowseUrl: '/Extensions/HtmlEditor/ckeditor/ckfinder/ckfinder.html?Type=Images',
                                                            filebrowserFlashBrowseUrl: '/Extensions/HtmlEditor/ckeditor/ckfinder/ckfinder.html?Type=Flash',
                                                            filebrowserUploadUrl: '/Extensions/HtmlEditor/ckeditor/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
                                                            filebrowserImageUploadUrl: '/Extensions/HtmlEditor/ckeditor/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
                                                            filebrowserFlashUploadUrl: '/Extensions/HtmlEditor/ckeditor/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
                                                        }
                                                    );
                                                    });
                                                </script>                                                                                                 
                                                <textarea style="display: none;" name="ContentDetail" id="ContentDetail" rows="3" cols="10"><%=Model.Article.ArticleContent %></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height: 10px;">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            
                        </div>

                    </div>

                </div>

                <div class="ui-widget-content ui-corner-top ui-corner-bottom">
                    <div id="toolbox">
                        <div class="header" style="float:left;">
                            <img id="Img1" src="/Content/Images/header/icon-news.png" style="border-width: 0px;">
                            <span id="ctl00_cph_Main_ctl00_ctl00_toolbox2_lblTitle">Sửa thông tin tin tức</span>
                        </div>
                        <div style="float:right;">

                             <table class="toolbar">
                                <tbody>
                                    <tr>               
                                        <td align="center">
                                            <a href="#" class="toolbar" onclick="beginUpload();" title="Lưu" id="A1"><span class="Icon-32-Save" title="Lưu" id="Span1"></span>Lưu</a>
                                        </td>

                                        <td align="center">
                                            <a href="#" class="toolbar" onclick="beginUpdate();" title="Cập nhật" id="A2"><span class="Icon-32-Apply" title="Cập nhật" id="Span2"></span>Cập nhật</a>
                                        </td>

                                        <td align="center">
                                            <a href="/Article" class="toolbar" title="Quay lại" id="A3"><span class="Icon-32-Back" title="Quay lại" id="Span3"></span>Quay lại</a>
                                        </td>

                                    </tr>
                                </tbody>
                            </table>    

                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <script type="text/javascript">
        $j(document).ready(function() {
            
        });
        function beginUpload() {
            $j("#CheckType").val("save_and_back");
            $j("#formCreate").submit();
        }
        function beginUpdate() {
            $j("#CheckType").val("save_and_check");
            $j("#formCreate").submit();
        }     
    </script>
    </form>

</asp:Content>
